/**
 * Generate time : 2011-05-19 10:47:26
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.ce.domain;

import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCEA4 table comment : 设备运行记录
 */
public class ZMCEA4 extends DaoEPBase {

	private String fdKeyId = " "; /* FD_KEY_ID */
	private String fdProductionUnitsId = " "; /* 生产单元ID */
	private String fdStartClock = " "; /* 开机时刻 */
	private String fdStopClock = " "; /* 停机时刻 */
	private String fdRunTime = " "; /* 运行时长(M) */

	private String fdDeviceLifetime = " "; /* 使用寿命(H) */
	private String fdSumRunTime = " "; /* 运行总时长 */
	private String fdName = " "; /* 生产单元名称 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdProductionUnitsId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("生产单元ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdStartClock");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("开机时刻");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdStopClock");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("停机时刻");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRunTime");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("运行时长(M)");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdSumRunTime");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("运行总时长");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDeviceLifetime");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("使用寿命(H)");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("生产单元名称");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCEA4() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - FD_KEY_ID
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - FD_KEY_ID
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdProductionUnitsId - 生产单元ID
	 * 
	 * @return the fdProductionUnitsId
	 */
	public String getFdProductionUnitsId() {
		return this.fdProductionUnitsId;
	}

	/**
	 * set the fdProductionUnitsId - 生产单元ID
	 */
	public void setFdProductionUnitsId(String fdProductionUnitsId) {
		this.fdProductionUnitsId = fdProductionUnitsId;
	}

	/**
	 * get the fdStartClock - 开机时刻
	 * 
	 * @return the fdStartClock
	 */
	public String getFdStartClock() {
		return this.fdStartClock;
	}

	/**
	 * set the fdStartClock - 开机时刻
	 */
	public void setFdStartClock(String fdStartClock) {
		this.fdStartClock = fdStartClock;
	}

	/**
	 * get the fdStopClock - 停机时刻
	 * 
	 * @return the fdStopClock
	 */
	public String getFdStopClock() {
		return this.fdStopClock;
	}

	/**
	 * set the fdStopClock - 停机时刻
	 */
	public void setFdStopClock(String fdStopClock) {
		this.fdStopClock = fdStopClock;
	}

	/**
	 * get the fdRunTime - 运行时长(M)
	 * 
	 * @return the fdRunTime
	 */
	public String getFdRunTime() {
		return this.fdRunTime;
	}

	/**
	 * set the fdRunTime - 运行时长(M)
	 */
	public void setFdRunTime(String fdRunTime) {
		this.fdRunTime = fdRunTime;
	}

	/**
	 * get the fdSumRunTime - 运行总时长
	 * 
	 * @return the fdSumRunTime
	 */
	public String getFdSumRunTime() {
		return this.fdSumRunTime;
	}

	/**
	 * set the fdSumRunTime - 运行总时长
	 */
	public void setFdSumRunTime(String fdSumRunTime) {
		this.fdSumRunTime = fdSumRunTime;
	}

	/**
	 * get the fdDeviceLifetime - 使用寿命(H)
	 * 
	 * @return the fdDeviceLifetime
	 */
	public String getFdDeviceLifetime() {
		return this.fdDeviceLifetime;
	}

	/**
	 * set the fdDeviceLifetime - 使用寿命(H)
	 */
	public void setFdDeviceLifetime(String fdDeviceLifetime) {
		this.fdDeviceLifetime = fdDeviceLifetime;
	}

	/**
	 * get the fdName - 生产单元名称
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * set the fdName - 生产单元名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdProductionUnitsId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdProductionUnitsId")), fdProductionUnitsId));
		setFdStartClock(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdStartClock")), fdStartClock));
		setFdStopClock(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdStopClock")), fdStopClock));
		setFdRunTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRunTime")), fdRunTime));

		setFdSumRunTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdSumRunTime")), fdSumRunTime));
		setFdDeviceLifetime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDeviceLifetime")), fdDeviceLifetime));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdProductionUnitsId", StringUtils.toString(fdProductionUnitsId, eiMetadata.getMeta("fdProductionUnitsId")));
		map.put("fdStartClock", StringUtils.toString(fdStartClock, eiMetadata.getMeta("fdStartClock")));
		map.put("fdStopClock", StringUtils.toString(fdStopClock, eiMetadata.getMeta("fdStopClock")));
		map.put("fdRunTime", StringUtils.toString(fdRunTime, eiMetadata.getMeta("fdRunTime")));

		map.put("fdSumRunTime", StringUtils.toString(fdSumRunTime, eiMetadata.getMeta("fdSumRunTime")));
		map.put("fdDeviceLifetime", StringUtils.toString(fdDeviceLifetime, eiMetadata.getMeta("fdDeviceLifetime")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));

		return map;

	}
}